//
//  PayMode.m
//  记账本
//
//  Created by lirilu on 15/3/13.
//  Copyright (c) 2015年 glirlu@gmail.com. All rights reserved.
//

#import "PayMode.h"

@implementation PayMode

+ (NSString*)filePath{
    NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)objectAtIndex:0];
    NSString *path = [docPath stringByAppendingPathComponent:@"PayMode.data"];
    return path;
}

//归档解档的时候会用到
- (void)encodeWithCoder:(NSCoder *)aCoder{
    [aCoder encodeObject:[NSString stringWithFormat:@"%d",self.ID] forKey:@"ID"];
    [aCoder encodeObject:[NSString stringWithFormat:@"%d",self.FlagID] forKey:@"FlagID"];
    [aCoder encodeObject:self.DoTime forKey:@"DoTime"];
    [aCoder encodeObject:self.Name forKey:@"Name"];
    [aCoder encodeObject:self.Detail forKey:@"Detail"];

}
- (id)initWithCoder:(NSCoder *)aDecoder {
    self.ID = (int)[[aDecoder decodeObjectForKey:@"ID"] integerValue];
    self.FlagID = (int)[[aDecoder decodeObjectForKey:@"FlagID"] integerValue];
    self.DoTime = [aDecoder decodeObjectForKey:@"DoTime"];
    self.Name = [aDecoder decodeObjectForKey:@"Name"];
    self.Detail = [aDecoder decodeObjectForKey:@"Detail"];
    return self;
}
@end
